﻿using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

namespace Studio
{
	// Token: 0x020005A5 RID: 1445
	public class MPFolderCtrl : MonoBehaviour
	{
		// Token: 0x1700046B RID: 1131
		// (set) Token: 0x060024B4 RID: 9396 RVA: 0x000DA838 File Offset: 0x000D8A38
		public OCIFolder ociFolder
		{
			set
			{
				this.m_OCIFolder = value;
				if (this.m_OCIFolder != null)
				{
					this.UpdateInfo();
				}
			}
		}

		// Token: 0x1700046C RID: 1132
		// (get) Token: 0x060024B5 RID: 9397 RVA: 0x000DA854 File Offset: 0x000D8A54
		// (set) Token: 0x060024B6 RID: 9398 RVA: 0x000DA85C File Offset: 0x000D8A5C
		public bool active
		{
			get
			{
				return this.m_Active;
			}
			set
			{
				this.m_Active = value;
				base.gameObject.SetActive(this.m_Active && this.m_OCIFolder != null);
			}
		}

		// Token: 0x060024B7 RID: 9399 RVA: 0x000DA890 File Offset: 0x000D8A90
		private void UpdateInfo()
		{
			if (this.m_OCIFolder == null)
			{
				return;
			}
			this.isUpdateInfo = true;
			this.inputName.text = this.m_OCIFolder.name;
			this.isUpdateInfo = false;
		}

		// Token: 0x060024B8 RID: 9400 RVA: 0x000DA8C4 File Offset: 0x000D8AC4
		private void OnEndEditName(string _value)
		{
			if (this.isUpdateInfo)
			{
				return;
			}
			this.m_OCIFolder.name = _value;
		}

		// Token: 0x060024B9 RID: 9401 RVA: 0x000DA8E0 File Offset: 0x000D8AE0
		private void Start()
		{
			this.inputName.onEndEdit.AddListener(new UnityAction<string>(this.OnEndEditName));
		}

		// Token: 0x04002562 RID: 9570
		[SerializeField]
		private InputField inputName;

		// Token: 0x04002563 RID: 9571
		private OCIFolder m_OCIFolder;

		// Token: 0x04002564 RID: 9572
		private bool m_Active;

		// Token: 0x04002565 RID: 9573
		private bool isUpdateInfo;
	}
}
